<?php
error_reporting(0);
include_once '../comm/config.php';
include_once '../comm/checkpostandget.php';
include_once 'phpzip.lib.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>下载返现宝</title>
</head>

<body>
<?php
$username=iconv('utf-8','gb2312',$_GET['username']);
$fxbname=iconv('utf-8','gb2312',FXBNAME);
if($username==''||$username=='输入您的用户名'){
	echo "<script language=javascript>alert('出错了，请输入您的用户名后再下载！');</script>";	
	exit;
}


$q = "SELECT * from ".$BIAOTOU."user where ddusername='".$_GET['username']."'";
$rs = mysql_query($q);
$num = mysql_num_rows($rs);
if($num==0)
{   	
	echo "<script language=javascript>alert('帐号 ".$username." 不是本站的有效帐号，请重新输入！');</script>";
	exit;
}
else{
	$row = mysql_fetch_array($rs);
	$userid=$row['Id'];
	$somecontent="REGEDIT4
	
	[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt]
	
	[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\\".$fxbname."]
	
	@=\"http://".URL."/fanxianbao/fanxianbao.html?".$userid."\"";
	  
	$ziper = new zipfile();
	//$ziper->addDir("test_dir");
	$ziper->addFile($somecontent,"fanxianbao.reg");
	$ziper->output("fanxianbao.rar");
}
mysql_close();
echo "<script language=javascript>window.location=\"fanxianbao.rar\";</script>";
?>
</body>
</html>